package com.voygern.task1.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.voygern.task1.dao.UserDao;
import com.voygern.task1.model.User;

@Service
public class UserService {
	@Autowired
	private UserDao userDao;
	public int add(User user)
	{
		return userDao.add(user);
	}
	public int deleteUser(long id)
	{
		return userDao.deleteUserById(id);
	}
	public int changeUserUpdate_at(String name,int update_at)
	{
		return userDao.changeUpdateAtByUsername(name, update_at);
	}
	public User queryUserById(int id)
	{
		return userDao.queryUserById(id);
	}
	public List<User> queryAllUsers()
	{
		return userDao.queryAll();
	}

}
